<?php

namespace app\api\controller\settings;

use app\api\controller\Controller;
use app\api\model\product\ProductBrandRelationModel;
use app\api\model\settings\DicModel;
use app\Request;
use app\shop\model\product\BrandModel;

/**
 * 商品分类控制器
 */
class Dic extends Controller
{
	/**
	 * 品牌列表
	 */
	public function getConfigData(Request $request)
	{
		$params = $request->param();
		$list = DicModel::listAll($params, [], 'sort_num desc');
		return $this->renderSuccess('', compact('list'));
	}

	/**
	 * 配置
	 */
	public function getConfigSys(Request $request)
	{
		$params = $request->param();
		$list = [];
		if($params['type']=='txt'){
			$list['join_img'] = "https://ossimg.jiumaioda.com/wechat/net-work-off.png";
			$list['join_text'] = ["该地区暂未开通配送服务","已为您推荐南宁市旗舰店"];
			$list['join_phone'] = "4001808119";
		}
		return $this->renderSuccess('', compact('list'));
	}


    public function getConfigDataDetail(Request $request)
    {
        $params = $request->param();
        $data = DicModel::get($params);
        return $this->renderSuccess('', compact('data'));
    }
}
